{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Fictional Army - Filtering and Sorting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Introduction:\n",
    "\n",
    "This exercise was inspired by this [page](http://chrisalbon.com/python/)\n",
    "\n",
    "Special thanks to: https://github.com/chrisalbon for sharing the dataset and materials.\n",
    "\n",
    "### Step 1. Import the necessary libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 2. This is the data given as a dictionary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create an example dataframe about a fictional army\n",
    "raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks', 'Dragoons', 'Dragoons', 'Dragoons', 'Dragoons', 'Scouts', 'Scouts', 'Scouts', 'Scouts'],\n",
    "            'company': ['1st', '1st', '2nd', '2nd', '1st', '1st', '2nd', '2nd','1st', '1st', '2nd', '2nd'],\n",
    "            'deaths': [523, 52, 25, 616, 43, 234, 523, 62, 62, 73, 37, 35],\n",
    "            'battles': [5, 42, 2, 2, 4, 7, 8, 3, 4, 7, 8, 9],\n",
    "            'size': [1045, 957, 1099, 1400, 1592, 1006, 987, 849, 973, 1005, 1099, 1523],\n",
    "            'veterans': [1, 5, 62, 26, 73, 37, 949, 48, 48, 435, 63, 345],\n",
    "            'readiness': [1, 2, 3, 3, 2, 1, 2, 3, 2, 1, 2, 3],\n",
    "            'armored': [1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1],\n",
    "            'deserters': [4, 24, 31, 2, 3, 4, 24, 31, 2, 3, 2, 3],\n",
    "            'origin': ['Arizona', 'California', 'Texas', 'Florida', 'Maine', 'Iowa', 'Alaska', 'Washington', 'Oregon', 'Wyoming', 'Louisana', 'Georgia']}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 3. Create a dataframe and assign it to a variable called army. \n",
    "\n",
    "#### Don't forget to include the columns names in the order presented in the dictionary ('regiment', 'company', 'deaths'...) so that the column index order is consistent with the solutions. If omitted, pandas will order the columns alphabetically."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "index",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        }
       ],
       "ref": "4131b398-c689-4291-9b0d-3a2f41947ee3",
       "rows": [
        [
         "0",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4",
         "Arizona"
        ],
        [
         "1",
         "Nighthawks",
         "1st",
         "52",
         "42",
         "957",
         "5",
         "2",
         "0",
         "24",
         "California"
        ],
        [
         "2",
         "Nighthawks",
         "2nd",
         "25",
         "2",
         "1099",
         "62",
         "3",
         "1",
         "31",
         "Texas"
        ],
        [
         "3",
         "Nighthawks",
         "2nd",
         "616",
         "2",
         "1400",
         "26",
         "3",
         "1",
         "2",
         "Florida"
        ],
        [
         "4",
         "Dragoons",
         "1st",
         "43",
         "4",
         "1592",
         "73",
         "2",
         "0",
         "3",
         "Maine"
        ],
        [
         "5",
         "Dragoons",
         "1st",
         "234",
         "7",
         "1006",
         "37",
         "1",
         "1",
         "4",
         "Iowa"
        ],
        [
         "6",
         "Dragoons",
         "2nd",
         "523",
         "8",
         "987",
         "949",
         "2",
         "0",
         "24",
         "Alaska"
        ],
        [
         "7",
         "Dragoons",
         "2nd",
         "62",
         "3",
         "849",
         "48",
         "3",
         "1",
         "31",
         "Washington"
        ],
        [
         "8",
         "Scouts",
         "1st",
         "62",
         "4",
         "973",
         "48",
         "2",
         "0",
         "2",
         "Oregon"
        ],
        [
         "9",
         "Scouts",
         "1st",
         "73",
         "7",
         "1005",
         "435",
         "1",
         "0",
         "3",
         "Wyoming"
        ],
        [
         "10",
         "Scouts",
         "2nd",
         "37",
         "8",
         "1099",
         "63",
         "2",
         "1",
         "2",
         "Louisana"
        ],
        [
         "11",
         "Scouts",
         "2nd",
         "35",
         "9",
         "1523",
         "345",
         "3",
         "1",
         "3",
         "Georgia"
        ]
       ],
       "shape": {
        "columns": 10,
        "rows": 12
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "      <th>origin</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>Arizona</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>52</td>\n",
       "      <td>42</td>\n",
       "      <td>957</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "      <td>California</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "      <td>Texas</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Florida</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>1592</td>\n",
       "      <td>73</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Maine</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>234</td>\n",
       "      <td>7</td>\n",
       "      <td>1006</td>\n",
       "      <td>37</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>Iowa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "      <td>Alaska</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>849</td>\n",
       "      <td>48</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "      <td>Washington</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>62</td>\n",
       "      <td>4</td>\n",
       "      <td>973</td>\n",
       "      <td>48</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>Oregon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>73</td>\n",
       "      <td>7</td>\n",
       "      <td>1005</td>\n",
       "      <td>435</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Wyoming</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>37</td>\n",
       "      <td>8</td>\n",
       "      <td>1099</td>\n",
       "      <td>63</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Louisana</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>35</td>\n",
       "      <td>9</td>\n",
       "      <td>1523</td>\n",
       "      <td>345</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Georgia</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      regiment company  deaths  battles  size  veterans  readiness  armored  \\\n",
       "0   Nighthawks     1st     523        5  1045         1          1        1   \n",
       "1   Nighthawks     1st      52       42   957         5          2        0   \n",
       "2   Nighthawks     2nd      25        2  1099        62          3        1   \n",
       "3   Nighthawks     2nd     616        2  1400        26          3        1   \n",
       "4     Dragoons     1st      43        4  1592        73          2        0   \n",
       "5     Dragoons     1st     234        7  1006        37          1        1   \n",
       "6     Dragoons     2nd     523        8   987       949          2        0   \n",
       "7     Dragoons     2nd      62        3   849        48          3        1   \n",
       "8       Scouts     1st      62        4   973        48          2        0   \n",
       "9       Scouts     1st      73        7  1005       435          1        0   \n",
       "10      Scouts     2nd      37        8  1099        63          2        1   \n",
       "11      Scouts     2nd      35        9  1523       345          3        1   \n",
       "\n",
       "    deserters      origin  \n",
       "0           4     Arizona  \n",
       "1          24  California  \n",
       "2          31       Texas  \n",
       "3           2     Florida  \n",
       "4           3       Maine  \n",
       "5           4        Iowa  \n",
       "6          24      Alaska  \n",
       "7          31  Washington  \n",
       "8           2      Oregon  \n",
       "9           3     Wyoming  \n",
       "10          2    Louisana  \n",
       "11          3     Georgia  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 4. Set the 'origin' colum as the index of the dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 5. Print only the column veterans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "4a563480-d15b-4eb1-a5e7-424425cac7f7",
       "rows": [
        [
         "Arizona",
         "1"
        ],
        [
         "California",
         "5"
        ],
        [
         "Texas",
         "62"
        ],
        [
         "Florida",
         "26"
        ],
        [
         "Maine",
         "73"
        ],
        [
         "Iowa",
         "37"
        ],
        [
         "Alaska",
         "949"
        ],
        [
         "Washington",
         "48"
        ],
        [
         "Oregon",
         "48"
        ],
        [
         "Wyoming",
         "435"
        ],
        [
         "Louisana",
         "63"
        ],
        [
         "Georgia",
         "345"
        ]
       ],
       "shape": {
        "columns": 1,
        "rows": 12
       }
      },
      "text/plain": [
       "origin\n",
       "Arizona         1\n",
       "California      5\n",
       "Texas          62\n",
       "Florida        26\n",
       "Maine          73\n",
       "Iowa           37\n",
       "Alaska        949\n",
       "Washington     48\n",
       "Oregon         48\n",
       "Wyoming       435\n",
       "Louisana       63\n",
       "Georgia       345\n",
       "Name: veterans, dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 6. Print the columns 'veterans' and 'deaths'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "cb306689-5d7e-425d-82f8-f3f5fb76769d",
       "rows": [
        [
         "Arizona",
         "1",
         "523"
        ],
        [
         "California",
         "5",
         "52"
        ],
        [
         "Texas",
         "62",
         "25"
        ],
        [
         "Florida",
         "26",
         "616"
        ],
        [
         "Maine",
         "73",
         "43"
        ],
        [
         "Iowa",
         "37",
         "234"
        ],
        [
         "Alaska",
         "949",
         "523"
        ],
        [
         "Washington",
         "48",
         "62"
        ],
        [
         "Oregon",
         "48",
         "62"
        ],
        [
         "Wyoming",
         "435",
         "73"
        ],
        [
         "Louisana",
         "63",
         "37"
        ],
        [
         "Georgia",
         "345",
         "35"
        ]
       ],
       "shape": {
        "columns": 2,
        "rows": 12
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>veterans</th>\n",
       "      <th>deaths</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>1</td>\n",
       "      <td>523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <td>5</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>62</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>26</td>\n",
       "      <td>616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>73</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Iowa</th>\n",
       "      <td>37</td>\n",
       "      <td>234</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>949</td>\n",
       "      <td>523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Washington</th>\n",
       "      <td>48</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <td>48</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wyoming</th>\n",
       "      <td>435</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Louisana</th>\n",
       "      <td>63</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Georgia</th>\n",
       "      <td>345</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            veterans  deaths\n",
       "origin                      \n",
       "Arizona            1     523\n",
       "California         5      52\n",
       "Texas             62      25\n",
       "Florida           26     616\n",
       "Maine             73      43\n",
       "Iowa              37     234\n",
       "Alaska           949     523\n",
       "Washington        48      62\n",
       "Oregon            48      62\n",
       "Wyoming          435      73\n",
       "Louisana          63      37\n",
       "Georgia          345      35"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 7. Print the name of all the columns."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['regiment', 'company', 'deaths', 'battles', 'size', 'veterans',\n",
       "       'readiness', 'armored', 'deserters'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 8. Select the 'deaths', 'size' and 'deserters' columns from Maine and Alaska"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "58e9cbdb-a98a-4fe0-ab6f-2c368f5233a9",
       "rows": [
        [
         "Maine",
         "43",
         "1592",
         "3"
        ],
        [
         "Alaska",
         "523",
         "987",
         "24"
        ]
       ],
       "shape": {
        "columns": 3,
        "rows": 2
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>deaths</th>\n",
       "      <th>size</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>43</td>\n",
       "      <td>1592</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>523</td>\n",
       "      <td>987</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        deaths  size  deserters\n",
       "origin                         \n",
       "Maine       43  1592          3\n",
       "Alaska     523   987         24"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 9. Select the rows 3 to 7 and the columns 3 to 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "834ddb56-c127-43e9-8b65-a54f91474282",
       "rows": [
        [
         "Texas",
         "25",
         "2",
         "1099",
         "62"
        ],
        [
         "Florida",
         "616",
         "2",
         "1400",
         "26"
        ],
        [
         "Maine",
         "43",
         "4",
         "1592",
         "73"
        ],
        [
         "Iowa",
         "234",
         "7",
         "1006",
         "37"
        ],
        [
         "Alaska",
         "523",
         "8",
         "987",
         "949"
        ]
       ],
       "shape": {
        "columns": 4,
        "rows": 5
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>1592</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Iowa</th>\n",
       "      <td>234</td>\n",
       "      <td>7</td>\n",
       "      <td>1006</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         deaths  battles  size  veterans\n",
       "origin                                  \n",
       "Texas        25        2  1099        62\n",
       "Florida     616        2  1400        26\n",
       "Maine        43        4  1592        73\n",
       "Iowa        234        7  1006        37\n",
       "Alaska      523        8   987       949"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 10. Select every row after the fourth row and all columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "0a201cff-80ee-4aba-8640-5b1fbd1877ca",
       "rows": [
        [
         "Maine",
         "Dragoons",
         "1st",
         "43",
         "4",
         "1592",
         "73",
         "2",
         "0",
         "3"
        ],
        [
         "Iowa",
         "Dragoons",
         "1st",
         "234",
         "7",
         "1006",
         "37",
         "1",
         "1",
         "4"
        ],
        [
         "Alaska",
         "Dragoons",
         "2nd",
         "523",
         "8",
         "987",
         "949",
         "2",
         "0",
         "24"
        ],
        [
         "Washington",
         "Dragoons",
         "2nd",
         "62",
         "3",
         "849",
         "48",
         "3",
         "1",
         "31"
        ],
        [
         "Oregon",
         "Scouts",
         "1st",
         "62",
         "4",
         "973",
         "48",
         "2",
         "0",
         "2"
        ],
        [
         "Wyoming",
         "Scouts",
         "1st",
         "73",
         "7",
         "1005",
         "435",
         "1",
         "0",
         "3"
        ],
        [
         "Louisana",
         "Scouts",
         "2nd",
         "37",
         "8",
         "1099",
         "63",
         "2",
         "1",
         "2"
        ],
        [
         "Georgia",
         "Scouts",
         "2nd",
         "35",
         "9",
         "1523",
         "345",
         "3",
         "1",
         "3"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 8
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>1592</td>\n",
       "      <td>73</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Iowa</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>234</td>\n",
       "      <td>7</td>\n",
       "      <td>1006</td>\n",
       "      <td>37</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Washington</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>849</td>\n",
       "      <td>48</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>62</td>\n",
       "      <td>4</td>\n",
       "      <td>973</td>\n",
       "      <td>48</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wyoming</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>73</td>\n",
       "      <td>7</td>\n",
       "      <td>1005</td>\n",
       "      <td>435</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Louisana</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>37</td>\n",
       "      <td>8</td>\n",
       "      <td>1099</td>\n",
       "      <td>63</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Georgia</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>35</td>\n",
       "      <td>9</td>\n",
       "      <td>1523</td>\n",
       "      <td>345</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                     \n",
       "Maine       Dragoons     1st      43        4  1592        73          2   \n",
       "Iowa        Dragoons     1st     234        7  1006        37          1   \n",
       "Alaska      Dragoons     2nd     523        8   987       949          2   \n",
       "Washington  Dragoons     2nd      62        3   849        48          3   \n",
       "Oregon        Scouts     1st      62        4   973        48          2   \n",
       "Wyoming       Scouts     1st      73        7  1005       435          1   \n",
       "Louisana      Scouts     2nd      37        8  1099        63          2   \n",
       "Georgia       Scouts     2nd      35        9  1523       345          3   \n",
       "\n",
       "            armored  deserters  \n",
       "origin                          \n",
       "Maine             0          3  \n",
       "Iowa              1          4  \n",
       "Alaska            0         24  \n",
       "Washington        1         31  \n",
       "Oregon            0          2  \n",
       "Wyoming           0          3  \n",
       "Louisana          1          2  \n",
       "Georgia           1          3  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 11. Select every row up to the 4th row and all columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "ee17663c-9127-4e43-b96d-842f7bffd1fa",
       "rows": [
        [
         "Arizona",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4"
        ],
        [
         "California",
         "Nighthawks",
         "1st",
         "52",
         "42",
         "957",
         "5",
         "2",
         "0",
         "24"
        ],
        [
         "Texas",
         "Nighthawks",
         "2nd",
         "25",
         "2",
         "1099",
         "62",
         "3",
         "1",
         "31"
        ],
        [
         "Florida",
         "Nighthawks",
         "2nd",
         "616",
         "2",
         "1400",
         "26",
         "3",
         "1",
         "2"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 4
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>52</td>\n",
       "      <td>42</td>\n",
       "      <td>957</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                       \n",
       "Arizona     Nighthawks     1st     523        5  1045         1          1   \n",
       "California  Nighthawks     1st      52       42   957         5          2   \n",
       "Texas       Nighthawks     2nd      25        2  1099        62          3   \n",
       "Florida     Nighthawks     2nd     616        2  1400        26          3   \n",
       "\n",
       "            armored  deserters  \n",
       "origin                          \n",
       "Arizona           1          4  \n",
       "California        0         24  \n",
       "Texas             1         31  \n",
       "Florida           1          2  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 12. Select the 3rd column up to the 7th column"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "71b80090-f2ab-40fd-ac46-53378114b362",
       "rows": [
        [
         "Arizona",
         "523",
         "5",
         "1045",
         "1",
         "1"
        ],
        [
         "California",
         "52",
         "42",
         "957",
         "5",
         "2"
        ],
        [
         "Texas",
         "25",
         "2",
         "1099",
         "62",
         "3"
        ],
        [
         "Florida",
         "616",
         "2",
         "1400",
         "26",
         "3"
        ],
        [
         "Maine",
         "43",
         "4",
         "1592",
         "73",
         "2"
        ],
        [
         "Iowa",
         "234",
         "7",
         "1006",
         "37",
         "1"
        ],
        [
         "Alaska",
         "523",
         "8",
         "987",
         "949",
         "2"
        ],
        [
         "Washington",
         "62",
         "3",
         "849",
         "48",
         "3"
        ],
        [
         "Oregon",
         "62",
         "4",
         "973",
         "48",
         "2"
        ],
        [
         "Wyoming",
         "73",
         "7",
         "1005",
         "435",
         "1"
        ],
        [
         "Louisana",
         "37",
         "8",
         "1099",
         "63",
         "2"
        ],
        [
         "Georgia",
         "35",
         "9",
         "1523",
         "345",
         "3"
        ]
       ],
       "shape": {
        "columns": 5,
        "rows": 12
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <td>52</td>\n",
       "      <td>42</td>\n",
       "      <td>957</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>1592</td>\n",
       "      <td>73</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Iowa</th>\n",
       "      <td>234</td>\n",
       "      <td>7</td>\n",
       "      <td>1006</td>\n",
       "      <td>37</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Washington</th>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>849</td>\n",
       "      <td>48</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <td>62</td>\n",
       "      <td>4</td>\n",
       "      <td>973</td>\n",
       "      <td>48</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wyoming</th>\n",
       "      <td>73</td>\n",
       "      <td>7</td>\n",
       "      <td>1005</td>\n",
       "      <td>435</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Louisana</th>\n",
       "      <td>37</td>\n",
       "      <td>8</td>\n",
       "      <td>1099</td>\n",
       "      <td>63</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Georgia</th>\n",
       "      <td>35</td>\n",
       "      <td>9</td>\n",
       "      <td>1523</td>\n",
       "      <td>345</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            deaths  battles  size  veterans  readiness\n",
       "origin                                                \n",
       "Arizona        523        5  1045         1          1\n",
       "California      52       42   957         5          2\n",
       "Texas           25        2  1099        62          3\n",
       "Florida        616        2  1400        26          3\n",
       "Maine           43        4  1592        73          2\n",
       "Iowa           234        7  1006        37          1\n",
       "Alaska         523        8   987       949          2\n",
       "Washington      62        3   849        48          3\n",
       "Oregon          62        4   973        48          2\n",
       "Wyoming         73        7  1005       435          1\n",
       "Louisana        37        8  1099        63          2\n",
       "Georgia         35        9  1523       345          3"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 13. Select rows where df.deaths is greater than 50"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "da499d8d-3fae-46b4-97a2-2d6c13a884c0",
       "rows": [
        [
         "Arizona",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4"
        ],
        [
         "California",
         "Nighthawks",
         "1st",
         "52",
         "42",
         "957",
         "5",
         "2",
         "0",
         "24"
        ],
        [
         "Florida",
         "Nighthawks",
         "2nd",
         "616",
         "2",
         "1400",
         "26",
         "3",
         "1",
         "2"
        ],
        [
         "Iowa",
         "Dragoons",
         "1st",
         "234",
         "7",
         "1006",
         "37",
         "1",
         "1",
         "4"
        ],
        [
         "Alaska",
         "Dragoons",
         "2nd",
         "523",
         "8",
         "987",
         "949",
         "2",
         "0",
         "24"
        ],
        [
         "Washington",
         "Dragoons",
         "2nd",
         "62",
         "3",
         "849",
         "48",
         "3",
         "1",
         "31"
        ],
        [
         "Oregon",
         "Scouts",
         "1st",
         "62",
         "4",
         "973",
         "48",
         "2",
         "0",
         "2"
        ],
        [
         "Wyoming",
         "Scouts",
         "1st",
         "73",
         "7",
         "1005",
         "435",
         "1",
         "0",
         "3"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 8
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>52</td>\n",
       "      <td>42</td>\n",
       "      <td>957</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Iowa</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>234</td>\n",
       "      <td>7</td>\n",
       "      <td>1006</td>\n",
       "      <td>37</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Washington</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>849</td>\n",
       "      <td>48</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>62</td>\n",
       "      <td>4</td>\n",
       "      <td>973</td>\n",
       "      <td>48</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wyoming</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>73</td>\n",
       "      <td>7</td>\n",
       "      <td>1005</td>\n",
       "      <td>435</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                       \n",
       "Arizona     Nighthawks     1st     523        5  1045         1          1   \n",
       "California  Nighthawks     1st      52       42   957         5          2   \n",
       "Florida     Nighthawks     2nd     616        2  1400        26          3   \n",
       "Iowa          Dragoons     1st     234        7  1006        37          1   \n",
       "Alaska        Dragoons     2nd     523        8   987       949          2   \n",
       "Washington    Dragoons     2nd      62        3   849        48          3   \n",
       "Oregon          Scouts     1st      62        4   973        48          2   \n",
       "Wyoming         Scouts     1st      73        7  1005       435          1   \n",
       "\n",
       "            armored  deserters  \n",
       "origin                          \n",
       "Arizona           1          4  \n",
       "California        0         24  \n",
       "Florida           1          2  \n",
       "Iowa              1          4  \n",
       "Alaska            0         24  \n",
       "Washington        1         31  \n",
       "Oregon            0          2  \n",
       "Wyoming           0          3  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 14. Select rows where df.deaths is greater than 500 or less than 50"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "bbfafc50-0197-4c4a-aa65-a2a95a746421",
       "rows": [
        [
         "Arizona",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4"
        ],
        [
         "Texas",
         "Nighthawks",
         "2nd",
         "25",
         "2",
         "1099",
         "62",
         "3",
         "1",
         "31"
        ],
        [
         "Florida",
         "Nighthawks",
         "2nd",
         "616",
         "2",
         "1400",
         "26",
         "3",
         "1",
         "2"
        ],
        [
         "Maine",
         "Dragoons",
         "1st",
         "43",
         "4",
         "1592",
         "73",
         "2",
         "0",
         "3"
        ],
        [
         "Alaska",
         "Dragoons",
         "2nd",
         "523",
         "8",
         "987",
         "949",
         "2",
         "0",
         "24"
        ],
        [
         "Louisana",
         "Scouts",
         "2nd",
         "37",
         "8",
         "1099",
         "63",
         "2",
         "1",
         "2"
        ],
        [
         "Georgia",
         "Scouts",
         "2nd",
         "35",
         "9",
         "1523",
         "345",
         "3",
         "1",
         "3"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 7
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maine</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>1st</td>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>1592</td>\n",
       "      <td>73</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alaska</th>\n",
       "      <td>Dragoons</td>\n",
       "      <td>2nd</td>\n",
       "      <td>523</td>\n",
       "      <td>8</td>\n",
       "      <td>987</td>\n",
       "      <td>949</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Louisana</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>37</td>\n",
       "      <td>8</td>\n",
       "      <td>1099</td>\n",
       "      <td>63</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Georgia</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>35</td>\n",
       "      <td>9</td>\n",
       "      <td>1523</td>\n",
       "      <td>345</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                     \n",
       "Arizona   Nighthawks     1st     523        5  1045         1          1   \n",
       "Texas     Nighthawks     2nd      25        2  1099        62          3   \n",
       "Florida   Nighthawks     2nd     616        2  1400        26          3   \n",
       "Maine       Dragoons     1st      43        4  1592        73          2   \n",
       "Alaska      Dragoons     2nd     523        8   987       949          2   \n",
       "Louisana      Scouts     2nd      37        8  1099        63          2   \n",
       "Georgia       Scouts     2nd      35        9  1523       345          3   \n",
       "\n",
       "          armored  deserters  \n",
       "origin                        \n",
       "Arizona         1          4  \n",
       "Texas           1         31  \n",
       "Florida         1          2  \n",
       "Maine           0          3  \n",
       "Alaska          0         24  \n",
       "Louisana        1          2  \n",
       "Georgia         1          3  "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 15. Select all the regiments not named \"Dragoons\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "5581e4e1-6cf8-462f-9ca7-9f66ed170428",
       "rows": [
        [
         "Arizona",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4"
        ],
        [
         "California",
         "Nighthawks",
         "1st",
         "52",
         "42",
         "957",
         "5",
         "2",
         "0",
         "24"
        ],
        [
         "Texas",
         "Nighthawks",
         "2nd",
         "25",
         "2",
         "1099",
         "62",
         "3",
         "1",
         "31"
        ],
        [
         "Florida",
         "Nighthawks",
         "2nd",
         "616",
         "2",
         "1400",
         "26",
         "3",
         "1",
         "2"
        ],
        [
         "Oregon",
         "Scouts",
         "1st",
         "62",
         "4",
         "973",
         "48",
         "2",
         "0",
         "2"
        ],
        [
         "Wyoming",
         "Scouts",
         "1st",
         "73",
         "7",
         "1005",
         "435",
         "1",
         "0",
         "3"
        ],
        [
         "Louisana",
         "Scouts",
         "2nd",
         "37",
         "8",
         "1099",
         "63",
         "2",
         "1",
         "2"
        ],
        [
         "Georgia",
         "Scouts",
         "2nd",
         "35",
         "9",
         "1523",
         "345",
         "3",
         "1",
         "3"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 8
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>California</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>52</td>\n",
       "      <td>42</td>\n",
       "      <td>957</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Florida</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>616</td>\n",
       "      <td>2</td>\n",
       "      <td>1400</td>\n",
       "      <td>26</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Oregon</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>62</td>\n",
       "      <td>4</td>\n",
       "      <td>973</td>\n",
       "      <td>48</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wyoming</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>1st</td>\n",
       "      <td>73</td>\n",
       "      <td>7</td>\n",
       "      <td>1005</td>\n",
       "      <td>435</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Louisana</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>37</td>\n",
       "      <td>8</td>\n",
       "      <td>1099</td>\n",
       "      <td>63</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Georgia</th>\n",
       "      <td>Scouts</td>\n",
       "      <td>2nd</td>\n",
       "      <td>35</td>\n",
       "      <td>9</td>\n",
       "      <td>1523</td>\n",
       "      <td>345</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                       \n",
       "Arizona     Nighthawks     1st     523        5  1045         1          1   \n",
       "California  Nighthawks     1st      52       42   957         5          2   \n",
       "Texas       Nighthawks     2nd      25        2  1099        62          3   \n",
       "Florida     Nighthawks     2nd     616        2  1400        26          3   \n",
       "Oregon          Scouts     1st      62        4   973        48          2   \n",
       "Wyoming         Scouts     1st      73        7  1005       435          1   \n",
       "Louisana        Scouts     2nd      37        8  1099        63          2   \n",
       "Georgia         Scouts     2nd      35        9  1523       345          3   \n",
       "\n",
       "            armored  deserters  \n",
       "origin                          \n",
       "Arizona           1          4  \n",
       "California        0         24  \n",
       "Texas             1         31  \n",
       "Florida           1          2  \n",
       "Oregon            0          2  \n",
       "Wyoming           0          3  \n",
       "Louisana          1          2  \n",
       "Georgia           1          3  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 16. Select the rows called Texas and Arizona"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "regiment",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "company",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "battles",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "size",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "veterans",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "readiness",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "armored",
         "rawType": "int64",
         "type": "integer"
        },
        {
         "name": "deserters",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "8abf448c-c193-46ee-996f-19223bfceb9d",
       "rows": [
        [
         "Texas",
         "Nighthawks",
         "2nd",
         "25",
         "2",
         "1099",
         "62",
         "3",
         "1",
         "31"
        ],
        [
         "Arizona",
         "Nighthawks",
         "1st",
         "523",
         "5",
         "1045",
         "1",
         "1",
         "1",
         "4"
        ]
       ],
       "shape": {
        "columns": 9,
        "rows": 2
       }
      },
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>regiment</th>\n",
       "      <th>company</th>\n",
       "      <th>deaths</th>\n",
       "      <th>battles</th>\n",
       "      <th>size</th>\n",
       "      <th>veterans</th>\n",
       "      <th>readiness</th>\n",
       "      <th>armored</th>\n",
       "      <th>deserters</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>origin</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Texas</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>2nd</td>\n",
       "      <td>25</td>\n",
       "      <td>2</td>\n",
       "      <td>1099</td>\n",
       "      <td>62</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Arizona</th>\n",
       "      <td>Nighthawks</td>\n",
       "      <td>1st</td>\n",
       "      <td>523</td>\n",
       "      <td>5</td>\n",
       "      <td>1045</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           regiment company  deaths  battles  size  veterans  readiness  \\\n",
       "origin                                                                    \n",
       "Texas    Nighthawks     2nd      25        2  1099        62          3   \n",
       "Arizona  Nighthawks     1st     523        5  1045         1          1   \n",
       "\n",
       "         armored  deserters  \n",
       "origin                       \n",
       "Texas          1         31  \n",
       "Arizona        1          4  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 17. Select the third cell in the row named Arizona"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "origin",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "deaths",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "7612b5e1-f043-44b6-b7af-1156ebf9028f",
       "rows": [
        [
         "Arizona",
         "523"
        ]
       ],
       "shape": {
        "columns": 1,
        "rows": 1
       }
      },
      "text/plain": [
       "origin\n",
       "Arizona    523\n",
       "Name: deaths, dtype: int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 18. Select the third cell down in the column named deaths"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.microsoft.datawrangler.viewer.v0+json": {
       "columns": [
        {
         "name": "index",
         "rawType": "object",
         "type": "string"
        },
        {
         "name": "Texas",
         "rawType": "int64",
         "type": "integer"
        }
       ],
       "ref": "d92bd101-0e14-4b3a-bffe-060f2863daee",
       "rows": [
        [
         "deaths",
         "25"
        ]
       ],
       "shape": {
        "columns": 1,
        "rows": 1
       }
      },
      "text/plain": [
       "deaths    25\n",
       "Name: Texas, dtype: int64"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "constructor",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
